Skip to content

Add a Decoder#1

Open
yutotakano wants to merge 15 commits intoalios:masterfrom
yutotakano:add-decoder
Open

Add a Decoder#1
yutotakano wants to merge 15 commits intoalios:masterfrom
yutotakano:add-decoder

Conversation

@yutotakano
Copy link

Hello Markus!

I found your library while searching for OPUS bindings for Haskell. Your encoder has been really useful.

As I see it, the code only has an Encoder, but I'd love to decode some OPUS audio as well. So here's a pull request!

Changes in this PR

  • Added Codec.Audio.Opus.Decoder, which mirrors the Encoder variant for the most part, but also all specs in the OPUS API PDF
  • Added Codec.Audio.Opus.Decoder.Conduit, which mirrors the Encoder variant closely.
  • Added test vector tests for the new decoder, which mirrors the run_vectors.sh file in the OPUS repo

Decoder tests

The tests require opus_compare executable in the project root (which can be obtained by compiling this file), and the new opus test vectors (https://opus-codec.org/static/testvectors/opus_testvectors-rfc8251.tar.gz), but once those are in place, passes properly:

Screenshot 2022-01-11_21-04-38

I would've loved to add similar tests for the Encoder, but the original run_vectors.sh only had decoder testing so I haven't pursued further.

I hope you can take a look/review it, and hopefully merge it in!

@yutotakano
Copy link
Author

Whoops, noticed something, converting to a draft temporarily.

@yutotakano yutotakano marked this pull request as draft January 11, 2022 21:22
@yutotakano
Copy link
Author

yutotakano commented Jan 11, 2022

Fixed, ready for review!

@yutotakano yutotakano marked this pull request as ready for review January 11, 2022 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant